﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InstantSpine.Core
{
    /// <summary>
    /// Signals whether a provided script could be compiled
    /// successfuly
    /// </summary>
    [Serializable]
    public sealed class CompilationException : Exception
    {
        public override System.Collections.IDictionary Data {
            get {
                base.Data.Add("ErrorCaption", ErrorCaption);
                base.Data.Add("ErrorMessage", ErrorMessage);
                return base.Data;
            }
        }

        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) {
            base.GetObjectData(info, context);
        }
        
        public string ErrorCaption { get; private set; }
        public string ErrorMessage { get; private set; }

        public CompilationException(string caption, string msg) {
            this.ErrorCaption = caption;
            this.ErrorMessage = msg;
        }
    }
}
